home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 263 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: news.hds.co.uk!john
  2. From: Gary Walsh <Gary_Walsh@spire.hds.co.uk>
  3. Newsgroups: comp.lang.c,comp.os.ms-windows.nt.misc,comp.programming,comp.std.c,comp.unix.aix
  4. Subject: Re: function pointers
  5. Date: 1 Feb 1996 10:05:36 GMT
  6. Organization: Hitachi Data Systems
  7. Message-ID: <4eq39g$4i9@willow.hds.co.uk>
  8. References: <4eogio$gt0@giga.bga.com> <4eohgr$gt0@giga.bga.com>
  9. NNTP-Posting-Host: hdsep.hds.co.uk
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
  14.  
  15. makuch@bga.com (Michael Makuch) wrote:
  16. >In article <4eogio$gt0@giga.bga.com>, makuch@bga.com says...
  17. >>
  18. >>The following c code segment compiles and works on
  19. >>NT MSVC++ and on SVR4 C compiler, but errors out
  20. >>on AIX with a type mismatch;
  21. >>
  22. >>struct foostruct1 * myfoo1();
  23. >>struct foostruct2 * myfoo2();
  24. >>void *(*ptr)();
  25.  
  26. Make that:
  27.  
  28. typedef void *(*fptr)();
  29. fptr ptr;
  30.  
  31. >>
  32. >>ptr = myfoo1;
  33. >>[snip]
  34. >>ptr = myfoo2;
  35. >>
  36. >
  37. >Oops. What I meant to say at the end there was that
  38. >
  39. >prt = (void *)myfoo1();
  40.  
  41. Try:
  42.  
  43. ptr = (fptr) myfoo1();
  44.  
  45. >
  46. >doesn't work either.
  47. >
  48. >Thanx.
  49. >mkm@abm.austin.tx.us
  50. >
  51.  
  52.  
  53.  
  54. -- 
  55. _____________________________________________________________________
  56. Gary Walsh                         E-mail: Gary_Walsh@spire.hds.co.uk
  57. Open Systems Product Specialist    Phone:  +44 1753 618806
  58. Hitachi Data Systems               Fax:    +44 1753 618576
  59. Sefton Park
  60. Stoke Poges                        Disclaimer: My views, not HDS'
  61. Buckinghamshire SL2 4HD
  62. England
  63. _____________________________________________________________________
  64.  
  65.  
  66.